#ifndef     __STIR_MOTOR_H
#define     __STIR_MOTOR_H

#include "../../utils/nocopyable.h"
#include "../../utils/object.h"
#include "../../rtos/mutex.h"

namespace driver {

class StirMotor : private utils::NoCopyable {

public:
    StirMotor();

    void open();

    void close_once();

    inline bool is_open() {
        return m_open_count > 0;
    }

private:
    uint32_t m_open_count = 0;
    rtos::Mutex m_mutex;
};

inline utils::Object<StirMotor> stirMotor;

}

#endif
